<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu"%>
<%@taglib uri="/WEB-INF/tld/pageable.tld" prefix="pageable"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<c-rt:set var="midContextPath" value='<%=ServerValue.getMidContextPath()%>'/>
<c-rt:set var="tp" value="${pu:pageableTag('tpp', 10, 10)}"/>
<c-rt:set var="hql">
from ViewWishList where memberId = ?
</c-rt:set>
<c-rt:set var="params" value="${pu:addToList('paras', param.memberId)}"/>
<%-- 这个是注解
<c-rt:set var="params" value="${pu:addToList('paras', pu:toLong('23'))}"/>
--%>
<c-rt:set var="viewWishLists" value="${pu:queryByHql(hql, params, tp)}"/>
<s:actionerror />
<s:actionmessage />
<s:fielderror />
<table class="tb-1" width="100%">
	<thead>
		<tr>
			<th>#</th>
			<th>項目</th>
			<th>商品明细</th>
			<th>单价</th>
			<th>加入追踪日期</th>
		</tr>
	</thead>
	<c-rt:choose>
		<c-rt:when test="${not empty viewWishLists}">
			<tbody>
				<c-rt:forEach items="${viewWishLists}" var="wishList"
					varStatus="rows_index">
					<tr class="${rows_index.count % 2 == 0 ? 'bg-yl' : ''}">
						<td>${rows_index.count }</td>
						<c-rt:choose>
							<c-rt:when test="${empty wishList.productId}">
							<td>類別</td>
							<td>${wishList.categoryPath}</td>
							<td>-----</td>
							</c-rt:when>
							<c-rt:otherwise>
								<td>商品</td>
								<td>${wishList.productName}</td>
								<td>${empty wishList.shelfPrice ? "已卖完，补货中":wishList.shelfPrice}</td>
							</c-rt:otherwise>
						</c-rt:choose>
						<td><fmt-rt:formatDate value="${wishList.createDate}"
							pattern="yyyy-MM-dd HH:mm" /></td>
					</tr>
				</c-rt:forEach>
			</tbody>
		</c-rt:when>
		<c-rt:otherwise>
			<tbody>
				<tr class="bg-yl">
					<td colspan="5">查无资料!!</td>
				</tr>
			</tbody>
		</c-rt:otherwise>
	</c-rt:choose>
</table>
<pageable:Pageable url="${midContextPath}/member/wishList!search.do" escapeparams="AJAX,refreshZone" parameter="AJAX=true&refreshZone=tabs-2" formname="NewWishListForm" key="tpp"></pageable:Pageable>